package com.yunji.generate.common;

import java.io.Serializable;

/**
 * @author hushuang
 * @since 2019/9/23
 */
public class ResultMessage implements Serializable {

    private boolean isSuccess;

    private String message;

    public ResultMessage() {
    }

    private ResultMessage(boolean isSuccess, String message) {
        this.isSuccess = isSuccess;
        this.message = message;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static ResultMessage success() {
        return success("成功");
    }

    public static ResultMessage success(String message) {
        return new ResultMessage(true, message);
    }

    public static ResultMessage fail(String message) {
        return new ResultMessage(false, message);
    }
}
